<!doctype html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Shiny editor</title>
    {{GOOGLE_TAG_MANAGER_SCRIPT}}
    <script src="../shinylive/load-shinylive-sw.js" type="module"></script>
    <script type="module">
      import { runApp } from "../shinylive/shinylive.js";

      // Note: When `allowCodeUrl`, `allowGistUrl`, and `allowExampleUrl` are
      // enabled, this page may run Python code provided in the URL (or from a
      // Gist). The Python code can in turn run JavaScript code. For security
      // reasons, if you enable any of these, then this site should be hosted on
      // a separate domain or subdomain from other content. Otherwise the
      // running of arbitrary code could be used, for example, to steal cookies.
      const runAppOpts = {
        allowCodeUrl: true,
        allowGistUrl: true,
        allowExampleUrl: true,
        // This option causes shinylive to update the URL hash when the user
        // clicks on the re-run button in the editor. It is false by default.
        // It should be set to true only when the editor and viewer are used
        // in a full-window configuration. If you are using the editor and
        // viewer embedded in a larger page, it does not make sense to set
        // this to true.
        updateUrlHashOnRerun: true,
        setWindowTitle: {
          prefix: "Shiny - ",
          defaultTitle: document.title,
        },
      };

      const appRoot = document.getElementById("root");
      runApp(appRoot, "editor-terminal-viewer", runAppOpts, "{{APP_ENGINE}}");
    </script>
    <link rel="stylesheet" href="../shinylive/style-resets.css" />
    <link rel="stylesheet" href="../shinylive/shinylive.css" />
  </head>
  <body>
    <div
      style="height: 100vh; width: 100vw; display: flex; flex-direction: column"
      id="root"
    ></div>
  </body>
</html>
